import type { BasePageReq } from '@wlydfe/service'
import type { CreditSalesDashboardModel, WhiteListModel } from './types'
import type { WaybillLoanLeadsModel } from './types/waybill-loan-list'
import http from '@/service'

/**
 * 获取授信贷款白名单信息表
 *
 * @param data 分页请求参数
 */
export const getWhiteList = (data: BasePageReq<Partial<WhiteListModel>>) => {
  return http.post<WhiteListModel[]>({
    url: '/credit/wlist/queryPage',
    data,
  })
}

/**
 * 获取运单贷意向企业列表
 *
 * @param data
 */
export const getWaybillLoanLeadsList = (data: BasePageReq<Partial<WaybillLoanLeadsModel>>) => {
  return http.post<WaybillLoanLeadsModel[]>({
    url: '/credit/intention/queryPage',
    data,
  })
}

/**
 * 获取销售看板列表
 *
 * @param data
 */
export const getSaleDashboardList = (data: BasePageReq<Partial<CreditSalesDashboardModel>>) => {
  return http.post<CreditSalesDashboardModel[]>({
    url: '/credit/sales/dashboard/queryPage',
    data,
  })
}
